package Feb_10.Task;

import java.io.File;
import java.util.Scanner;

public class Task2 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        System.out.print("输入路径:");
        try {
            File file = new File(scanner.nextLine());
            String[] str = file.list();
            assert str != null;
            for (String i:str){
                System.out.println(i);
            }
        }catch (Exception e){
            System.out.println("不是有效的路径！");
        }
    }
}
